LongRange

class LongRange(start: Long, endInclusive: Long) : LongProgression, ClosedRange<Long>

A range of values of type Long.

Constructors

LongRange
Link copied to clipboard
fun LongRange(start: Long, endInclusive: Long)

Types

Companion
Link copied to clipboard
object Companion

Functions

contains
Link copied to clipboard
open operator override fun contains(value: Long): Boolean
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
isEmpty
Link copied to clipboard
open override fun isEmpty(): Boolean

Checks whether the range is empty.

iterator
Link copied to clipboard
open operator override fun iterator(): LongIterator
toString
Link copied to clipboard
open override fun toString(): String

Properties

endInclusive
Link copied to clipboard
open override val endInclusive: Long
first
Link copied to clipboard
val first: Long
last
Link copied to clipboard
val last: Long
start
Link copied to clipboard
open override val start: Long
step
Link copied to clipboard
val step: Long

Extensions

contains
Link copied to clipboard
inline operator fun LongRange.contains(element: Long?): Boolean

Returns true if this range contains the specified element.

random
Link copied to clipboard
inline fun LongRange.random(): Long

Returns a random element from this range.

fun LongRange.random(random: Random): Long

Returns a random element from this range using the specified source of randomness.

randomOrNull
Link copied to clipboard
inline fun LongRange.randomOrNull(): Long?

Returns a random element from this range, or null if this range is empty.

fun LongRange.randomOrNull(random: Random): Long?

Returns a random element from this range using the specified source of randomness, or null if this range is empty.